var express = require("express");
var app = express();

var path = require("path");
var exphbs = require("express-handlebars");
app.set("views", path.join(__dirname, "views"));
app.engine(".hbs", exphbs({
    layoutsDir: "views/layouts",
    defaultLayout: "main",
    extname: ".hbs"
}));
app.set("view engin", ".hbs");

var expressSession = require("express-session");
app.use(expressSession({
    secret: "suijishuzi",
    resave: false,
    saveUninitialized: true
}))
app.use(express.static("static"));
var routerMain = require("./router/main.js");
app.use("/", routerMain);
app.set("views", "views");
app.set("view engine", "ejs");
app.listen(8888);
console.log("开始监听端口8888")